- content_for :title_header do
  %h1
    = t("layouts.admin.admin")
    = "-"
    = t("admin.communities.analytics.analytics")

= render :partial => "admin/left_hand_navigation", :locals => { :links => admin_links_for(@current_community) }

.left-navi-section
  %h2= t(".analytics", :community_name => @community.name(I18n.locale))
  = form_for @community, :url => analytics_admin_community_path(@community), :method => :put do |form|
    .row
      %h3= t(".google_analytics_key")
    .row
      .col-6
        - if display_knowledge_base_articles
          - instructions_link = link_to(t("admin.communities.analytics.google_analytics_instructions_link_text"), "#{knowledge_base_url}/configuration-and-how-to/how-to-track-your-marketplace-traffic-with-google-analytics", target: '_blank')
          = render :partial => "layouts/info_text", :locals => { :text => t(".google_analytics_key_info_text_with_instructions", :instructions_link => instructions_link).html_safe }
        - else
          = render :partial => "layouts/info_text", :locals => { :text => t(".google_analytics_key_info_text") }
      .col-6
        =form.text_field :google_analytics_key, :maxlength => "15", :class => "text_field", :placeholder => "UA-12345-12"
    - if APP_CONFIG.admin_enable_tracking_config
      - sharetribe_analytics_instructions_link = (link_to(t(".sharetribe_analytics_instructions_link_text"), "#{knowledge_base_url}/how-to-disable-sharetribes-analytics", target: '_blank'))
      .row
        %h3= t(".sharetribe_analytics")
      .row
        .col-12
          = render :partial => "layouts/info_text", :locals => { :text => t(".sharetribe_analytics_info_text_with_instructions", :instructions_link => sharetribe_analytics_instructions_link).html_safe }
      .row
        .checkbox-container
          = form.check_box :end_user_analytics
          = form.label :end_user_analytics, t(".end_user_analytics"), :class => "settings-checkbox-label"
    .row
      %h3= t('.google_tag_manager')
    .row
      .col-12
        = t('.gtm_paragraph_1')
    .row
      .col-12
        - link = link_to t('.learn_how_to_configure_gtm'),
          "#{knowledge_base_url}/en/articles/2529555", target: '_blank'
        = t('.gtm_paragraph_2', link: link).html_safe
    .row
      = form.button t("admin.communities.analytics.save")

